﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using TodoMVC.BusinessServices;

namespace TodoMVC.Main.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class SqliteDBController : ControllerBase
    {
        public SqliteDBBusinessService _sqliteDBBusinessService { get; set; }

        public SqliteDBController(SqliteDBBusinessService sqliteDBBusinessService)
        {
            _sqliteDBBusinessService = sqliteDBBusinessService;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        [HttpGet("BackupDB")]
        public async Task<ActionResult<bool>> BackupDB()
        {
            return await _sqliteDBBusinessService.BackupDB();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        //[HttpGet("RestoreDB")]
        //public async Task<ActionResult<bool>> RestoreDB()
        //{
        //    return await Task.FromResult(true);
        //}
    }
}
